﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_ClearData : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("CKXoaDanhMuc")]
        private CheckBox _CKXoaDanhMuc;
        [AccessedThroughProperty("CKxoaPhatSinh")]
        private CheckBox _CKxoaPhatSinh;
        [AccessedThroughProperty("CKXoaSoDuDauKy")]
        private CheckBox _CKXoaSoDuDauKy;
        [AccessedThroughProperty("CmdCancel")]
        private Button _CmdCancel;
        [AccessedThroughProperty("CmdOK")]
        private Button _CmdOK;
        [AccessedThroughProperty("GroupBox1")]
        private GroupBox _GroupBox1;
        private IContainer components;

        [DebuggerNonUserCode]
        public Frm_ClearData()
        {
            base.Load += new EventHandler(this.Frm_ClearData_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.InitializeComponent();
        }

        private void CKXoaDanhMuc_CheckedChanged(object sender, EventArgs e)
        {
            if (this.CKXoaDanhMuc.CheckState == CheckState.Checked)
            {
                this.CKxoaPhatSinh.CheckState = CheckState.Checked;
                this.CKxoaPhatSinh.Enabled = false;
                this.CKXoaSoDuDauKy.CheckState = CheckState.Checked;
                this.CKXoaSoDuDauKy.Enabled = false;
            }
            else
            {
                this.CKxoaPhatSinh.Enabled = true;
                this.CKXoaSoDuDauKy.Enabled = true;
            }
        }

        public bool ClearData()
        {
            bool flag=false;
            this.Cursor = Cursors.WaitCursor;
            IDataParameter[] commandParameters = new IDataParameter[3];
            int num2 = 0;
            int num3 = 0;
            int num = 0;
            if (this.CKXoaSoDuDauKy.Checked)
            {
                num2 = 1;
            }
            if (this.CKXoaDanhMuc.Checked)
            {
                num = 1;
            }
            if (this.CKxoaPhatSinh.Checked)
            {
                num3 = 1;
            }
            try
            {
                commandParameters[0] = DBHelper.createParameter("@ClearSoDuDauKy", DbType.Double, ParameterDirection.Input, num2);
                commandParameters[1] = DBHelper.createParameter("@ClearPhatSinh", DbType.Double, ParameterDirection.Input, num3);
                commandParameters[2] = DBHelper.createParameter("@ClearDanhMuc", DbType.Double, ParameterDirection.Input, num);
                DBHelper.ExecuteNonQuery(modGeneral.ConnectionString, CommandType.StoredProcedure, "HT_sp_ClearData", commandParameters);
                this.Cursor = Cursors.Default;
                flag = true;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                this.Cursor = Cursors.Default;
                MessageBox.Show(exception.Message);
                flag = false;
                ProjectData.ClearProjectError();
                return flag;
                ProjectData.ClearProjectError();
            }
            return flag;
        }

        private void CmdOK_Click(object sender, EventArgs e)
        {
            if (LVYModule.ConfirmDelete(modGeneral.Tranlated("Bạn thật sự muốn thực hiện nghiệp vụ n\x00e0y?", "")) && this.ClearData())
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Nghiệp vụ thực hiện th\x00e0nh c\x00f4ng", ""));
                MyProject.Forms.FRMMAIN.Dispose();
                Application.Restart();
            }
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        private void Frm_ClearData_Load(object sender, EventArgs e)
        {
            if (modGeneral.H_USERID != "000000000000000")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng thể thực hiện nghiệp vụ n\x00e0y! Li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_ClearData));
            this.CmdCancel = new Button();
            this.CmdOK = new Button();
            this.GroupBox1 = new GroupBox();
            this.CKXoaDanhMuc = new CheckBox();
            this.CKXoaSoDuDauKy = new CheckBox();
            this.CKxoaPhatSinh = new CheckBox();
            this.GroupBox1.SuspendLayout();
            this.SuspendLayout();
            this.CmdCancel.DialogResult = DialogResult.Cancel;
            this.CmdCancel.Image = (Image) manager.GetObject("CmdCancel.Image");
            this.CmdCancel.ImageAlign = ContentAlignment.MiddleLeft;
            Point point = new Point(0x10f, 0xac);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            Size size = new Size(0x4f, 0x18);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 9;
            this.CmdCancel.Text = "&Tho\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            this.CmdOK.Image = (Image) manager.GetObject("CmdOK.Image");
            this.CmdOK.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0xbc, 0xac);
            this.CmdOK.Location = point;
            this.CmdOK.Name = "CmdOK";
            size = new Size(0x4e, 0x18);
            this.CmdOK.Size = size;
            this.CmdOK.TabIndex = 8;
            this.CmdOK.Text = "&Chọn";
            this.CmdOK.UseVisualStyleBackColor = true;
            this.GroupBox1.BackColor = Color.Transparent;
            this.GroupBox1.Controls.Add(this.CKXoaDanhMuc);
            this.GroupBox1.Controls.Add(this.CKXoaSoDuDauKy);
            this.GroupBox1.Controls.Add(this.CKxoaPhatSinh);
            point = new Point(7, 7);
            this.GroupBox1.Location = point;
            this.GroupBox1.Name = "GroupBox1";
            size = new Size(0x158, 0x9f);
            this.GroupBox1.Size = size;
            this.GroupBox1.TabIndex = 10;
            this.GroupBox1.TabStop = false;
            this.GroupBox1.Text = "T\x00f9y chọn";
            this.CKXoaDanhMuc.AutoSize = true;
            point = new Point(0x53, 0x65);
            this.CKXoaDanhMuc.Location = point;
            this.CKXoaDanhMuc.Name = "CKXoaDanhMuc";
            size = new Size(0x5f, 0x11);
            this.CKXoaDanhMuc.Size = size;
            this.CKXoaDanhMuc.TabIndex = 2;
            this.CKXoaDanhMuc.Text = "X\x00f3a danh mục";
            this.CKXoaDanhMuc.UseVisualStyleBackColor = true;
            this.CKXoaSoDuDauKy.AutoSize = true;
            point = new Point(0x53, 0x44);
            this.CKXoaSoDuDauKy.Location = point;
            this.CKXoaSoDuDauKy.Name = "CKXoaSoDuDauKy";
            size = new Size(110, 0x11);
            this.CKXoaSoDuDauKy.Size = size;
            this.CKXoaSoDuDauKy.TabIndex = 1;
            this.CKXoaSoDuDauKy.Text = "X\x00f3a số dư đầu kỳ";
            this.CKXoaSoDuDauKy.UseVisualStyleBackColor = true;
            this.CKxoaPhatSinh.AutoSize = true;
            this.CKxoaPhatSinh.Checked = true;
            this.CKxoaPhatSinh.CheckState = CheckState.Checked;
            point = new Point(0x53, 0x24);
            this.CKxoaPhatSinh.Location = point;
            this.CKxoaPhatSinh.Name = "CKxoaPhatSinh";
            size = new Size(0x5b, 0x11);
            this.CKxoaPhatSinh.Size = size;
            this.CKxoaPhatSinh.TabIndex = 0;
            this.CKxoaPhatSinh.Text = "X\x00f3a ph\x00e1t sinh";
            this.CKxoaPhatSinh.UseVisualStyleBackColor = true;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            this.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            size = new Size(0x169, 0xca);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.GroupBox1);
            this.Controls.Add(this.CmdCancel);
            this.Controls.Add(this.CmdOK);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_ClearData";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "X\x00d3A DỮ LIỆU";
            this.GroupBox1.ResumeLayout(false);
            this.GroupBox1.PerformLayout();
            this.ResumeLayout(false);
        }

        internal virtual CheckBox CKXoaDanhMuc
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKXoaDanhMuc;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CKXoaDanhMuc_CheckedChanged);
                if (this._CKXoaDanhMuc != null)
                {
                    this._CKXoaDanhMuc.CheckedChanged -= handler;
                }
                this._CKXoaDanhMuc = value;
                if (this._CKXoaDanhMuc != null)
                {
                    this._CKXoaDanhMuc.CheckedChanged += handler;
                }
            }
        }

        internal virtual CheckBox CKxoaPhatSinh
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKxoaPhatSinh;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKxoaPhatSinh = value;
            }
        }

        internal virtual CheckBox CKXoaSoDuDauKy
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKXoaSoDuDauKy;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKXoaSoDuDauKy = value;
            }
        }

        internal virtual Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdCancel = value;
            }
        }

        internal virtual Button CmdOK
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdOK;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdOK_Click);
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click -= handler;
                }
                this._CmdOK = value;
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click += handler;
                }
            }
        }

        internal virtual GroupBox GroupBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox1 = value;
            }
        }
    }
}

